﻿@page "/test"
@attribute [TabItemOption(Text = "租户测试")]

<Privacy>
    <Card IsShadow="true" HeaderText="租户测试">
        <BodyTemplate>
            <Table TItem="GMS.NET.Dto.System.Test.Output.TestData" IsBordered="true" IsStriped="true" IndentSize="8" HeaderStyle="@TableHeaderStyle.Light"
                   OnQueryAsync="@OnQueryAsync" ShowToolbar="true" ShowExtendButtons="true"
                   OnSaveAsync="@OnSaveAsync" OnDeleteAsync="@OnDeleteAsync" ShowEditButton="false" EditDialogIsDraggable="true"
                   AddModalTitle="新增测试数据" EditModalTitle="编辑测试数据" ShowEmpty="true" IsPagination="true" IsMultipleSelect="true"
                   PageItemsSource="@(new int[] { 20, 40, 80, 100 })" ShowExportButton="true" OnExportAsync="OnExportAsync"
                   SearchMode="SearchMode.Top" ShowSearch="true" ShowSearchText="false" CustomerSearchModel="@TestSearchModel"
                   @ref="Table">
                <TableToolbarTemplate>
                    <TableToolbarButton TItem="GMS.NET.Dto.System.Test.Output.TestData"
                                        Color="Color.Primary"
                                        Icon="fas fa-fw fa-file-export"
                                        Text="导入"
                                        IsAsync />
                    @*OnClickCallback="@OpenUploadExcel"*@
                </TableToolbarTemplate>
                <TableColumns>
                    <TableColumn @bind-Field="@context.Test" />
                    <TableColumn @bind-Field="@context.Test2" />
                    <TableColumn @bind-Field="@context.Creator" />
                    <TableColumn @bind-Field="@context.Creationtime" />
                    <TableColumn @bind-Field="@context.Modifier" />
                    <TableColumn @bind-Field="@context.Modifytime" />
                </TableColumns>
                <EditTemplate Context="value">
                    <GMS.NET.Web.Components.Pages.Systems.Test.Shared.TestForm Context="value" />
                </EditTemplate>
                <CustomerSearchTemplate>
                    @if (context is GMS.NET.Web.Components.Pages.Systems.Test.Shared.TestSearchModel model)
                    {
                        <GMS.NET.Web.Components.Pages.Systems.Test.Shared.TestSearch @bind-Value="@model" />
                    }
                </CustomerSearchTemplate>
                <ExportButtonDropdownTemplate Context="ExportContext">
                    <div class="dropdown-item" @onclick="ExportContext.ExportAsync">
                        <i class="fa-regular fa-file-excel"></i>
                        <span>Excel-xlsx</span>
                    </div>
                </ExportButtonDropdownTemplate>
            </Table>
        </BodyTemplate>
    </Card>
</Privacy>

@code {

}
